﻿using Avalonia.ReactiveUI;
using AvaloniaApplication1.ViewModels;

namespace AvaloniaApplication1.Internal
{
    /// <summary>
    /// 抽象泛型 Window
    /// 通过依赖注入指定DataContext
    /// </summary>
    /// <typeparam name="VM"></typeparam>
    public class AbstractWindow<VM> : ReactiveWindow<VM> where VM : ViewModelBase
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public AbstractWindow()
        {
            this.DataContext = App.GetService<VM>();
        }
    }
}
